﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using BF.Infrastructure;

namespace BF.Infrastructure
{
    public interface IRepository<T> where T : class
    {
        void Add(T entity);
        void Delete(T entity);
        void Delete(Expression<Func<T, Boolean>> predicate);
        T GetModelByCondition(Expression<Func<T, bool>> predicate);

        List<T> GetList(Expression<Func<T, bool>> where, 
            Expression<Func<T, object>> orderBy, 
            PageModel pageModel, 
            bool isAscending);
        List<T> GetList(Expression<Func<T, bool>> where, 
            List<OrderBys<T>> orderBys, 
            PageModel pageModel);
        List<T> GetList(Expression<Func<T, bool>> where);

        int GetRowCount(Expression<Func<T, bool>> where);

        bool ExecuteProcedure(
            string sqlText, 
            params object[] parameters
            );

    }
}
